package components;

import java.awt.geom.Rectangle2D;

import entities.Entity;

public abstract class CollisionModel extends EntityComponent {

	public CollisionModel(Entity e) {
		super(e);
	}

	@Override
	public void tick(float dt) {
		// Nothing to do here
	}
	
	public abstract Rectangle2D getAABB();
	
	public boolean collidesWith(CollisionModel other) {
		return other != null && other != this && other.getAABB().intersects(getAABB());
	}

}
